﻿//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1998-2024 Glodon Company Limited.
//
// Licensed under the MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the “Software”),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include "GcmpGuiMainFrame.h"

#pragma warning(push)
#pragma warning(disable:4251)

#ifndef CTRL_ID
#define CTRL_ID  "ctrl_id"
#endif


namespace gcmp
{
    // 状态栏控件基类
    class GCMP_GUI_MAIN_FRAME_EXPORT StatusBarCtrl
    {
        CANNOT_COPY_OR_ASSIGN(StatusBarCtrl);
    public:
        StatusBarCtrl(const std::wstring& name, const std::wstring& caption, const std::wstring& tooltip = L"");
        virtual ~StatusBarCtrl(){}

        const std::wstring& GetName() const { return m_name;}
        const std::wstring& GetCaption() const { return m_caption; }
        const std::wstring& GetTooltip() const { return m_tooltip; }

        void SetCaption(const std::wstring& text) { m_caption = text; }
        void SetTooltip(const std::wstring& tooltip) { m_tooltip = tooltip; }

    private:
        std::wstring m_name;
        std::wstring m_caption;
        std::wstring m_tooltip;
    };

    // 状态栏按钮。
    class GCMP_GUI_MAIN_FRAME_EXPORT StatusBarButton : public StatusBarCtrl
    {
        DECLARE_SUPER(StatusBarCtrl);
        CANNOT_COPY_OR_ASSIGN(StatusBarButton);
    public:
        StatusBarButton(const std::wstring& name, const std::wstring& caption, const std::wstring& cmdIconPath, const std::wstring& tooltip = L"");
        virtual ~StatusBarButton(){}

    public:
        const std::wstring& GetIconPath() const { return m_cmdIconPath; }
        void SetIconPath(const std::wstring& cmdIconPath)
        {
            m_cmdIconPath = cmdIconPath;
        }

    private:
        // 图标路径。
        std::wstring   m_cmdIconPath;
    };

    // 状态栏选择框
    class GCMP_GUI_MAIN_FRAME_EXPORT StatusBarCheckBox : public StatusBarCtrl
    {
        DECLARE_SUPER(StatusBarCtrl);
        CANNOT_COPY_OR_ASSIGN(StatusBarCheckBox);
    public:
        StatusBarCheckBox(const std::wstring& name, const std::wstring& caption, const std::wstring& tooltip = L"");
        virtual ~StatusBarCheckBox(){}

    };

    // 状态栏选择框
    class GCMP_GUI_MAIN_FRAME_EXPORT StatusBarLabel : public StatusBarCtrl
    {
        DECLARE_SUPER(StatusBarCtrl);
        CANNOT_COPY_OR_ASSIGN(StatusBarLabel);
    public:
        StatusBarLabel(const std::wstring& name, const std::wstring& caption, const std::wstring& tooltip = L"");
        virtual ~StatusBarLabel(){}

    };

    // 状态栏进度条
    class GCMP_GUI_MAIN_FRAME_EXPORT StatusBarProgressBar : public StatusBarCtrl
    {
        DECLARE_SUPER(StatusBarCtrl);
        CANNOT_COPY_OR_ASSIGN(StatusBarProgressBar);
    public:
        StatusBarProgressBar(const std::wstring& name, const std::wstring& caption, const std::wstring& tooltip = L"");
        virtual ~StatusBarProgressBar() {}

    };

} // namespace gcmp

#pragma warning(pop)

